<!DOCTYPE html>
<html>
<head>
	<title>取消冒泡事件</title>
</head>
<body>
<div onclick="div1()">
	<h1>sdf</h1>
</div>
</body>
<script type="text/javascript">
	
var h1 = document.getElementsByTagName('h1')[0];
h1.onclick = function(e) {
	alert('user1');
	e.stopPropagation();
	// e.cancelable;		ie兼容
}
function div1() {
	alert('user2');
}

</script>
</html>